package org.eerbaar.parser.core.def.impl;

import java.util.ArrayList;
import java.util.Arrays;

import org.eerbaar.parser.core.def.NonTerminal;
import org.eerbaar.parser.core.def.Symbol;
import org.eerbaar.parser.core.def.TerminalProduction;

public class DefaultTerminalProduction
        extends DefaultProduction implements TerminalProduction {

    public DefaultTerminalProduction(NonTerminal lhs, Symbol rhs) {
        super();
        this.lhs = lhs;
        this.rhs = new ArrayList(Arrays.asList(new Symbol[] { rhs }));
    }

    public DefaultTerminalProduction(NonTerminal lhs, Symbol[] rhs) {
        super();
        this.lhs = lhs;
        this.rhs = Arrays.asList(rhs);
    }

    @Override
    public boolean equals(Object obj) {
        if (toString().equals(obj.toString())) {
            return true;
        }
        return false;
    }

}